package gov.pr.celepar.sentinela.util;

import gov.pr.celepar.framework.util.Reflexao;

import java.sql.PreparedStatement;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.resource.adapter.jdbc.WrappedPreparedStatement;

public class JDBCLogger {
	private static Log logger = LogFactory.getLog(JDBCLogger.class);

	public static void logSQL(PreparedStatement statement) {

		try {
			//logger.debug(Reflexao.invocaGet(statement, "underlyingStatement"));
		} catch (Exception e1) {
			e1.printStackTrace();
		}

		if (statement instanceof org.jboss.resource.adapter.jdbc.WrappedPreparedStatement) {
			try {
				WrappedPreparedStatement wrapper = (WrappedPreparedStatement) statement;
				//logger.debug(wrapper.getUnderlyingStatement());
			} catch (Exception e) {
				e.printStackTrace();
			}
		}

	}
}
